home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / EnterAct 3.5 / Drag_on Modules / hAWK programs / $Files_by_Size < prev    next >
Encoding:
Text File  |  1993-04-09  |  399 b   |  17 lines  |  [TEXT/KEEN]

  1. #$Files_by_Size : print name and size of input files, in order by size.
  2. # (largest file first)
  3. # Take input from: MFS selected files
  4. # Output is to stdout.
  5.  
  6. BEGIN {
  7.     for (i = 1; i < ARGC; ++i)
  8.         {
  9.         n = split(ARGV[i], names, ":")
  10.         outnames[i] =  names[n]
  11.         sizes[i] = fsize(ARGV[i])
  12.         }
  13.     maxIndex = sort(sizes, ind, "rn")
  14.     for (i = 1; i <= maxIndex; ++i)
  15.         print outnames[ind[i]], sizes[ind[i]]
  16.     }
  17.